#include "opencv2\opencv.hpp"
#include "opencv2\core\core.hpp"
#include <opencv2/nonfree/features2d.hpp>
#include "MatrixUtility.h"

#pragma once
class ForegroundExtractor
{


private:
	 cv::BackgroundSubtractorMOG2 MOG;
	 float LEARNING_RATE;
	 float AGE;
	 float THRESHOLD;
	 cv::Mat MEAN;
	 cv::Mat VAR;
	 int SOGLIA_AREA;
public:
	ForegroundExtractor::ForegroundExtractor(float learningrate,int soglia_area,int width,int height,int type = CV_8U ,bool detectShadow = false ,float age =5,float init_m=0,float init_s2=6,float thresold=0.01 );
	virtual ForegroundExtractor::~ForegroundExtractor(void);

	cv::vector<cv::vector<cv::Point>> ForegroundExtractor::extract(cv::Mat current);
	cv::Mat ForegroundExtractor::OpenCVMethod(cv::Mat current );
	cv::Mat ForegroundExtractor::DomenicoMethod(cv::Mat current );
	cv::vector<cv::vector<cv::Point>> ForegroundExtractor::Contours(cv::Mat foreground);


	static cv::Mat ForegroundExtractor::Float2CV_8UC1(cv::Mat_<float> m);
};

